<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
  </head>
  <body>
    <script>
      var a = 123;
      function fn1() {
        var b = 234;
        function fn2() {
          b++;
          console.log(b);
        }
        return fn2;
      }

      var result = fn1();
      fn1()() // 235
      fn1()() // 235
      fn1()() // 235
      fn1()()
      console.log(result);
    </script>
  </body>
</html>
